<%@page import="school.entity.Student"%>
<%@page import="school.dao.StudentDaoI"%>
<%@page import="school.dao.StudentDao"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'students.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
  <jsp:include page="checkLogin.jsp"></jsp:include>
  <a href="addStudent.jsp">新生注册</a>
    <table align="center" width="80%" border="1" cellpadding="0" cellspacing="0">
    <tr>
    <td>学号</td><td>姓名</td><td>手机号</td><td>性别</td><td>操作</td>
    </tr>
    <%
    	StudentDaoI sdao=new StudentDao();
    	List<Student> list=sdao.search();
    	for(Student s:list){
     %>
     <tr>
     	<td><%=s.getStuno() %></td>
     	<td><%=s.getSname() %></td>
     	<td><%=s.getTelephone() %></td>
     	<td><%=s.getSex() %></td>
     	<td><a onclick="return confirm('您是真的要删除[<%=s.getSname() %>]吗？')" href="studentDel.jsp?no=<%=s.getStuno()%>">删除</a>
     		<a href="toUpdateStudent.jsp?no=<%=s.getStuno()%>">修改</a>
     	</td>
     </tr>
     <%} %>
     </table>
  </body>
</html>
